list1 = ["rp_sr_1",
"rp_sr_2",
"rp_sr_3",
"rp_sr_4",
"PP_CS_4",
"PP_CS_2",
"PP_CS_4"]


list2 = ["rp_sr_1",
"rp_sr_2",
"rp_sr_3",
"rp_sr_4",
"rp_sr_5",
"rp_sr_6",
"PP_CS_1",
"PP_CS_2",
"PP_CS_4"]

from collections import Counter

def compare_lists(list1, list2):
    # 创建两个Counter对象
    counter1 = Counter(list1)
    counter2 = Counter(list2)

    # 找出共同元素及其数量
    common_elements = (counter1 & counter2)
    print("Common elements and counts:")
    print(common_elements)

    # 找出只在第一个列表中存在的元素及其数量
    unique_to_list1 = counter1 - counter2
    print("Unique to first list and counts:")
    print(unique_to_list1)

    # 找出只在第二个列表中存在的元素及其数量
    unique_to_list2 = counter2 - counter1
    print("Unique to second list and counts:")
    print(unique_to_list2)



# 调用函数
compare_lists(list1, list2)